import { http } from "@/utils/http";

export const getOvertrueConfig = (menuId?: string, _id?: string) => {
  return http.get("https://api.chendailong.cn/work/getOvertureConfig", {
    menuId,
    _id,
  });
};
export const getRouter = () => {
  return http.get("https://api.chendailong.cn/work/getRouter");
};
export const editOvertureConfig = (formData: any) => {
  return http.post(
    "https://api.chendailong.cn/work/editOvertureConfig",
    formData
  );
};
export const editOvertureState = ({ _id, status, sign, menuId }: any) => {
  return http.post("https://api.chendailong.cn/work/editOvertureState", {
    _id,
    status,
    sign,
    menuId,
  });
};

export const addOverture = (fromData: any) => {
  return http.post("https://api.chendailong.cn/work/addOverture", fromData);
};

export const getOverture = (parmes?: { code?: number; _id?: string }) => {
  return http.get("https://api.chendailong.cn/work/getOverture", parmes);
};

export const delOverture = (id: string) => {
  return http.get("https://api.chendailong.cn/work/delOverture", { id });
};

export const inviteSecond = (
  overtureId: string,
  secondId: string,
  code: number,
  codeName: string,
  codeColor: string,
  inviteTime: string
) => {
  return http.post("https://api.chendailong.cn/work/inviteSecond", {
    overtureId,
    code,
    codeName,
    codeColor,
    secondId,
    inviteTime,
  });
};
// 团长审核的接口
export const colonelAuditOverture = (colonelState: {
  overtureId: string;
  code: number;
  codeName: string;
  codeColor: string;
  nowCode: number;
  colonelAuditId: string;
  auditUser: string;
  opinion: string;
  sign: string | null;
}) => {
  return http.post("https://api.chendailong.cn/work/changeOvertureCode", {
    ...colonelState,
  });
};

// 团长审核的接口
export const preAuditOverture = (colonelState: {
  overtureId: string;
  code: number;
  codeName: string;
  codeColor: string;
  preAuditId: string;
  auditUser: string;
  auditTime: string;
  opinion: string;
  sign: string | null;
  nowCode: number;
}) => {
  return http.post("https://api.chendailong.cn/work/changeOvertureCode", {
    ...colonelState,
  });
};

// 立案审核的接口
export const registerAuditOverture = (colonelState: {
  overtureId: string;
  code: number;
  codeName: string;
  codeColor: string;
  registerAuditId: string;
  auditUser: string;
  auditTime: string;
  registerResult: string;
  registerID: string;
  hostUnit: string;
  assistUnit: string;
  opinion: string;
  sign: string | null;
  nowCode: number;
}) => {
  return http.post("https://api.chendailong.cn/work/changeOvertureCode", {
    ...colonelState,
  });
};

// 校工会主席审核的接口
export const unionChairmanAuditOverture = (colonelState: {
  overtureId: string;
  code: number;
  codeName: string;
  codeColor: string;
  unionChairmanId: string;
  auditUser: string;
  auditTime: string;
  opinion: string;
  sign: string | null;
  nowCode: number;
}) => {
  return http.post("https://api.chendailong.cn/work/changeOvertureCode", {
    ...colonelState,
  });
};
// 领导审批立案审核的接口
export const leadershipAuditOverture = (colonelState: {
  overtureId: string;
  code: number;
  codeName: string;
  codeColor: string;
  leadershipAuditId: string;
  auditUser: string;
  auditTime: string;
  opinion: string;
  sign: string | null;
  nowCode: number;
}) => {
  return http.post("https://api.chendailong.cn/work/changeOvertureCode", {
    ...colonelState,
  });
};

// 校长、书记审阅
export const presidentCheckAuditOverture = (colonelState: {
  overtureId: string;
  code: number;
  codeName: string;
  codeColor: string;
  presidentCheckAuditId: string;
  auditUser: string;
  auditTime: string;
  opinion: string;
  sign: string | null;
  nowCode: number;
}) => {
  return http.post("https://api.chendailong.cn/work/changeOvertureCode", {
    ...colonelState,
  });
};
// 校待确认承办单位
export const confirmUnitAuditOverture = (colonelState: {
  overtureId: string;
  code: number;
  codeName: string;
  codeColor: string;
  confirmUnitAuditId: string;
  auditUser: string;
  auditTime: string;
  hostUnit: string;
  assistUnit: string;
  opinion: string;
  sign: string | null;
  nowCode: number;
}) => {
  return http.post("https://api.chendailong.cn/work/changeOvertureCode", {
    ...colonelState,
  });
};

// 待承办单位答复
export const unionReplyAuditOverture = (colonelState: {
  overtureId: string;
  code: number;
  codeName: string;
  codeColor: string;
  unionReplyId: string;
  handleOpinion: string;
  auditUser: string;
  auditTime: string;
  opinion: string;
  sign: string | null;
  nowCode: number;
}) => {
  return http.post("https://api.chendailong.cn/work/changeOvertureCode", {
    ...colonelState,
  });
};

// 待领导审批答复
export const leaderReplyAuditOverture = (colonelState: {
  overtureId: string;
  code: number;
  codeName: string;
  codeColor: string;
  leaderReplyAuditId: string;
  auditUser: string;
  auditTime: string;
  opinion: string;
  sign: string | null;
  nowCode: number;
}) => {
  return http.post("https://api.chendailong.cn/work/changeOvertureCode", {
    ...colonelState,
  });
};

// 反馈评价
export const feedbackAuditOverture = (colonelState: {
  overtureId: string;
  code: number;
  codeName: string;
  codeColor: string;
  feedbackAuditId: string;
  satisfaction: string;
  auditUser: string;
  auditTime: string;
  opinion: string;
  sign: string | null;
  nowCode: number;
}) => {
  return http.post("https://api.chendailong.cn/work/changeOvertureCode", {
    ...colonelState,
  });
};

// 提案委员会审查
export const councilExamineAuditOverture = (colonelState: {
  overtureId: string;
  code: number;
  codeName: string;
  codeColor: string;
  councilExamineAuditId: string;
  auditUser: string;
  auditTime: string;
  opinion: string;
  sign: string | null;
  nowCode: number;
}) => {
  return http.post("https://api.chendailong.cn/work/changeOvertureCode", {
    ...colonelState,
  });
};

// 提案委员会审查
export const completedOpinionAuditOverture = (colonelState: {
  overtureId: string;
  code: number;
  codeName: string;
  codeColor: string;
  completedOpinionAuditId: string;
  auditUser: string;
  auditTime: string;
  opinion: string;
  sign: string | null;
  nowCode: number;
}) => {
  return http.post("https://api.chendailong.cn/work/changeOvertureCode", {
    ...colonelState,
  });
};
